package lab01;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/9/30.
 */
public class Test08 {
    public static void main(String[] args) {
        int count = 0;
        Scanner sc = new Scanner(System.in);
        int number = (int) (Math.random() * 100) + 1;
        while (true) {
            System.out.println("请输入1个到100的数");
            int a = sc.nextInt();
            if (a < number) {
                System.out.println("猜小了！");
            } else if (a > number) {
                System.out.println("猜大了！");
            } else {
                System.out.println("猜对了！");
            }
            count++;
            System.out.println(count + "次");
        }
    }
}
